<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input type="button" value="新爱好" @click="add">
    <input type="button" value="淘汰爱好" @click="remove">
    <ul>
        <li v-for="(item,index) in arr">
            {{index+1}}前端热门技术：{{item}}
        </li>
    </ul>
    <p v-for="item in hobbies" :title="item.name">
        {{item.name}}
    </p>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            arr:["HTML","CSS","JavaScript","Vue"],
            hobbies:[{name:"篮球"},{name:"阅读"}]
        },
        methods:{
            add:function () {
                this.hobbies.push({name:"学习"});
            },
            remove:function () {
                this.hobbies.shift();
            }
        }
    })

</script>
</body>
</html>